package p1;

import java.util.ArrayList;
import java.util.List;

public class A {

	private String hello = "hello";
	
	public A(String str) {
		hello = str;
		String mystr = "coucou";
		hello += " " + mystr;
	}
	
	
	public int test(String myString) throws Exception {
		int a = myString.hashCode();
		int b = a + 2;
		int c = 2*a + b;
		System.out.println("c = " + c);
		
		String[] tabs = new String[] {"a", "b", "c"};
		List<String> strs = new ArrayList<String>();
		for (String string : strs) {
			System.out.println(string);
		}
		for( int index = 0; index < strs.size(); index++) {
			myString += "" + index;
		}
		int i = 0;
		while (i < tabs.length) {
			myString += "" + tabs[i];
			i++;
		}
		int j=i,k=0;
		do {
			j++;
			k++;
		} while (j < tabs.length);
		
		try {
		if (j==k && i == b) {
			String coucou = "coucou";
			System.out.println(coucou);
		} else {
			throw new Exception("i = " + i);
		}
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		switch (i) {
			case 0:
				System.out.println(i + k +2);
				break;
			case 3:
				System.out.println(j+k);
				break;
			default:
					System.out.println(myString + i);
		}
		return i + j + k + myString.hashCode();
	}
}
